<%@page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:include page="commot/header.jsp"></jsp:include>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:if test="${num>0 }">
	<script type="text/javascript">
		alert("成功！");
</script>
</c:if>
<c:if test="${num<0 }">
	<script type="text/javascript">
		alert("失败！");
</script>
</c:if>

		
			<div id="privider_z">
				<div class="" role="tabpanel" data-example-id="togglable-tabs">
					<ul id="myTab1" class="nav nav-tabs bar_tabs right" role="tablist">
						<li role="presentation" class="active">
							<a href="#tab_content11" role="tab" id="profile-tabb" data-toggle="tab" aria-controls="home" aria-expanded="true">菜单信息</a>
						</li>
						<li role="presentation" class="">
							<a href="#tab_content22" id="home-tabb" role="tab" data-toggle="tab" aria-controls="profile" aria-expanded="false">添加菜单</a>
						</li>
						<li role="presentation" class="">
							<a href="#tab_content33" role="tab" id="profile-tabb3" data-toggle="tab" aria-controls="profile" aria-expanded="false">类型列表</a>
						</li>
						<li role="presentation" class="">
							<a href="#tab_content567" role="tab" data-toggle="tab" aria-controls="profile" aria-expanded="false">类型列表添加</a>
						</li>
					</ul>
					
					<div  id="myTabContent2" class="tab-content">
						<div role="tabpanel" class="tab-pane fade active in" id="tab_content11" aria-labelledby="home-tab">
							<div>
								<div class="row" >
							  			<c:forEach items="${lists.list}" var="list" varStatus="vars">
							  				<div style="display: inline-block; width: 220px;height: 220px; margin-left: 40px">
							   				<img style="width: 220px;height: 220px;" alt="" src="statics/imagesTow/${list.dishPicture}">
							        			<p style="font-size:18px ">${list.dish}&nbsp;&nbsp;<br/>单价:${list.dishPrice}元 </p>
							        			<a href="javascript:if(confirm('确认删除吗？')) location=' /privider?menuId=${list.menuId}&dishPicture=${list.dishPicture}'" style="font-size: 20px;right: 200px;">删除</a>
							        			&nbsp;&nbsp;&nbsp;<a  data-toggle="modal" data-target="#myModal${vars.index }" style="font-size: 20px;right: 200px;">修改</a>
													       								<!-- 模态框（Modal） -->
										<div class="modal fade" id="myModal${vars.index }" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
											<div class="modal-dialog">
												<div class="modal-content">
													<div class="modal-header">
														<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
															&times;
														</button>
														<h4 class="modal-title" id="myModalLabel">
															修改菜单信息
														</h4>
													</div>
													<form action="/update" id="demo-form2" data-parsley-validate="" class="form-horizontal form-label-left" enctype="multipart/form-data" method="post">
															<div class="form-group">
																<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">菜单名 <span class="required">*</span>
											                        </label>
																<div class="col-md-6 col-sm-6 col-xs-12">
																	<input type="text" id="first-name" required="required" name="dish" class="form-control col-md-7 col-xs-12" value="${list.dish}">
																</div>
															</div>
															<div class="form-group">
																<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">信息描述<span class="required">*</span>
											                        </label>
																<div class="col-md-6 col-sm-6 col-xs-12">
																	<input type="text" id="last-name" required="required" name="dishDetails" value="${list.dishDetails}" class="form-control col-md-7 col-xs-12">
																</div>
															</div>
															<div class="form-group">
																<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">菜单类型</label>
																<div class="col-md-6 col-sm-6 col-xs-12">
																	<select id="middle-name" name="menuTypeId" class="form-control col-md-7 col-xs-12">
																		<c:forEach items="${types}" var="type">
																		<option value="${type.menuTypeId}">${type.cate}</option>
																		</c:forEach>
																	</select>
																</div>
															</div>
															<div class="form-group">
																<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">菜单价格</label>
																<div class="col-md-6 col-sm-6 col-xs-12">
																	<input id="middle-name" value="${list.dishPrice}" name="dishPrice" class="form-control col-md-7 col-xs-12" type="text">
																</div>
															</div>
															<div class="form-group" hidden="hidden">
																<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">点赞</label>
																<div class="col-md-6 col-sm-6 col-xs-12">
																	<input id="middle-na" value="${list.like}" name="like" class="form-control col-md-7 col-xs-12" type="text">
																</div>
															</div>
															<div class="form-group" hidden="hidden">
																<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
																<div class="col-md-6 col-sm-6 col-xs-12">
																	<input id="middle-name" value="${list.menuId}" name="menuId" class="form-control col-md-7 col-xs-12" type="text">
																</div>
															</div>
															<div class="form-group" hidden="hidden">
																<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
																<div class="col-md-6 col-sm-6 col-xs-12">
																	<input id="middle-nam" value="${list.dishPicture}" name="dishPicture" class="form-control col-md-7 col-xs-12" type="text">
																</div>
															</div>
															<div class="form-group">
																<label class="control-label col-md-3 col-sm-3 col-xs-12">菜单图片 <span class="required">*</span>
											                        </label>
											                        <input type="file" name="pic" id="pic" value="图片上传">
															</div>
															<div class="ln_solid"></div>
															<div class="form-group">
																<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
																	<button type="reset" class="btn btn-primary">取消</button>
																	<button type="submit" class="btn btn-success">添加</button>
																</div>
															</div>
														</form>
												</div><!-- /.modal-content -->
											</div><!-- /.modal -->
										</div>
							       			
							       			
							       			
							       			
							       			
							       			</div>
							    		<c:if test="${vars.index==4}">
							    			<br/>
							    		</c:if>
							  		 	 </c:forEach>
						      		 <p style="text-align: right; margin-right: 70px;font-size: 20px;margin-top: 24px;"> 当前页数:[${lists.currentPageNo }/${lists.totalPageCount }]&nbsp;
									 <c:if test="${lists.currentPageNo<lists.totalPageCount  }">
			      					 <a href="/privider?currentPageNo=1">首页</a><a href="/privider?currentPageNo=${lists.currentPageNo+1 }">下一页</a> 
			    					</c:if>
	    							 <c:if test="${lists.currentPageNo>1}">
			      					 <a href="/privider?currentPageNo=${lists.currentPageNo-1 }">上一页</a> <a href="/privider?currentPageNo=${lists.totalPageCount }">末页</a> 
			  					</c:if>
	  						</p>
								</div>
							</div>
						</div>
						
						
						
						
						
						
						<div role="tabpanel" class="tab-pane fade" id="tab_content22" aria-labelledby="profile-tab">
							<p></p>
							<div>
								<form action="/privider" id="demo-form2" data-parsley-validate="" class="form-horizontal form-label-left" enctype="multipart/form-data" method="post">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">菜单名<span class="required">*</span>
					                        </label>
										<div class="col-md-6 col-sm-6 col-xs-12">
											<input type="text" id="first-name" required="required" name="dish" class="form-control col-md-7 col-xs-12">
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">信息描述<span class="required">*</span>
					                        </label>
										<div class="col-md-6 col-sm-6 col-xs-12">
											<input type="text" id="last-name" required="required" name="dishDetails" class="form-control col-md-7 col-xs-12">
										</div>
									</div>
									<div class="form-group">
										<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">菜单类型</label>
										<div class="col-md-6 col-sm-6 col-xs-12">
											<select id="middle-name" name="menuTypeId" class="form-control col-md-7 col-xs-12">
												<c:forEach items="${types}" var="type">
												<option value="${type.menuTypeId}">${type.cate}</option>
												</c:forEach>
											</select>
										</div>
									</div>
									<div class="form-group">
										<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">菜单价格</label>
										<div class="col-md-6 col-sm-6 col-xs-12">
											<input id="middle-name" name="dishPrice" class="form-control col-md-7 col-xs-12" type="text">
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12">菜单图片 <span class="required">*</span>
					                        </label>
					                        <input type="file" name="pic" id="pic" value="图片上传">
									</div>
									<div class="ln_solid"></div>
									<div class="form-group">
										<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
											<button type="reset" class="btn btn-primary">取消</button>
											<button type="submit" class="btn btn-success">添加</button>
										</div>
									</div>
								</form>
							</div>
						</div>
						<div role="tabpanel" class="tab-pane fade" id="tab_content33" aria-labelledby="profile-tab">
							<form id="typeList" method="post">
								<c:forEach items="${types}" var="type" varStatus="vars">
									<div style="margin-left: 30px;display: inline-block;font-size: 20px;">${vars.index+1}:&nbsp;&nbsp;&nbsp;${type.cate}
							  			   <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="del(${type.menuTypeId})" style="font-size: 20px;right: 200px;" >删除</a>
							  			   <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="upda('${type.menuTypeId}')" style="font-size: 20px;right: 200px;">修改</a>
									</div>
									<c:if test="${index.index==4 }">
										<br/>
									</c:if>
								</c:forEach>
							</form>
						</div>
						<div role="tabpanel" class="tab-pane fade" id="tab_content567" aria-labelledby="profile-tab">
							<form id="addType" >
									<div style="margin: 50px;"   >
										<label for="name">类型名字:</label>
										<input type="text" name="cate">
										<input type="button" onclick="addType()" value="添加">
									</div>
						 	</form>
						</div>

					</div>
				</div>
				<!-- page content -->
			</div>
			
			
				

<jsp:include page="commot/footer.jsp"></jsp:include>